package com.kingwang.training.ooad.coffeemaker.badway;

import com.kingwang.training.ooad.coffeemaker.hardware.api.BoilerState;
import com.kingwang.training.ooad.coffeemaker.hardware.api.CoffeeMakerApi;
import org.springframework.stereotype.Component;

/**
 * 加热器的加热元件
 *
 * @author King
 */
@Component
public class BoilerHeater extends Heater {
    public BoilerHeater(CoffeeMakerApi coffeeMakerApi) {
        super(coffeeMakerApi);
    }

    @Override
    public void on() {
        this.coffeeMakerApi.setBoilerState(BoilerState.ON);
    }

    @Override
    public void off() {
        this.coffeeMakerApi.setBoilerState(BoilerState.OFF);
    }
}
